import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:project2/%E6%88%91%E7%9A%84%E5%8F%91%E5%B8%83/WaitforPayment.dart';

main(){
  runApp(MyApp());
}

class MyApp extends StatelessWidget{
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          backgroundColor: Color.fromRGBO(51, 51, 51, 1),
          titleSpacing: 0.0,
          title:Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              FlatButton(
                materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
                child: Row(
                  children: [
                    Icon(Icons.arrow_back_ios,color: Colors.white,),
                    Text('返回',style: TextStyle(color: Colors.white,fontSize: 16),)
                  ],
                ),
                onPressed: (){
                  Navigator.pop(context);
                },
              ),
              Container(child: Row(children: [
                Text('我的发布',style: TextStyle(fontSize: 16,color: Colors.white),),
                SizedBox(width: 25,)
              ],),),
              IconButton(icon: Icon(Icons.more_horiz,color: Colors.white,), onPressed: (){})
            ],
          ),
        ),
        body: Container(
          child: _MyRelease(),
        ),
      ),
    );
  }
}

class _MyRelease extends StatefulWidget{
  MyRelease createState()=> MyRelease();
}

class MyTab {
  String title;
  bool active;
  Widget page;
  MyTab({this.title, this.active = false, this.page}) : super();
}

class MyRelease extends State<_MyRelease> {
  List<MyTab> tabs = [
    MyTab(title: "全部", active: true,page: page1()),
    MyTab(title: "待付款", page: page1()),
    MyTab(title: "待接单", page: page1()),
    MyTab(title: "待确认", page: page1()),
    MyTab(title: "已完成", page: page1()),
    MyTab(title: "已取消", page: page1()),


  ];

  int currentIndex=0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        child: Column(
          children: <Widget>[
            Row(
              children: buildTabItems(),
            ),
            Expanded(
              child: Container(
                child: tabs[currentIndex].page,
              ),
            )
          ],
        ),
      ),
    );
  }

  List<Widget> buildTabItems(){
    List<Widget> childrens=List<Widget>();
    for(int i=0;i<tabs.length;i++){
      childrens.add(Expanded(
        flex: 1,
        child: GestureDetector(
          onTap: (){
            setState(() {
              tabs.forEach((element) {
                element.active=false;
              });
              tabs[i].active=true;
              this.currentIndex=i;
            });
          },
          child: Container(
            height: 38,
            alignment: Alignment.center,
            child: Text("${tabs[i].title}"),
            decoration: BoxDecoration(
              border: Border(
                right: BorderSide(width: 1, color: Colors.grey.withOpacity(0.9)),
                bottom:tabs[i].active ? BorderSide(width: 2, color: Colors.black.withOpacity(0.55)) : BorderSide(width: 0, color: Colors.white),
              ),
            ),
          ),
        ),
      ));
    }
    return childrens;
  }
}

//-----------------------------下拉刷新重写----------------------------------------

class Myheader extends ClassicalHeader {
  final String refreshText='下拉刷新';
  final String refreshReadyText='松开立即刷新';
  final String refreshingText='正在刷新...';
  final Color infoColor=Colors.grey;
  final String infoText='获得最新发布订单';
  final String refreshedText='获取成功';
  final Color textColor=Color.fromRGBO(22,155,213,1);
}

//------------------------------------------------------------------------------


//-----------------------------构建page1----------------------------------------

class page1 extends StatefulWidget {
  page1state createState() => new page1state();
}

class page1state extends State {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      body: Container(
        color: Colors.grey.withOpacity(0.25),
        child: Container(

          child: Container(
            margin: EdgeInsets.only(top: 1),
              child:EasyRefresh(
                header: Myheader(),
                onRefresh: ()async{
                },
                child: ListView(
                  children: [
                    GestureDetector(
                      child: Container(
                        color: Colors.white,
                        height: 120,
                        margin: EdgeInsets.only(top: 1),
                        padding: EdgeInsets.only(top: 10,bottom: 0,left: 20,right: 20),
                        child: Container(
                          child: Column(
                            children: [
                              Container(
                                child: Row(
                                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                  children: [
                                    Container(
                                      child: Row(
                                        children: [
                                          Text('跑腿',style: TextStyle(color: Colors.black,fontSize: 12,),),
                                          SizedBox(width: 30,),
                                          Text('待付款',style: TextStyle(color: Colors.red,fontSize: 12),),
                                        ],
                                      ),
                                    ),
                                    Text('5元',style: TextStyle(color: Colors.black,fontSize: 13),)
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(top: 8),
                                alignment: Alignment.topLeft,
                                child: Column(
                                  mainAxisAlignment: MainAxisAlignment.start,
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  children: [
                                    Container(
                                      margin: EdgeInsets.only(bottom: 8),
                                      child: Text('任务主题（限制20字）...',style: TextStyle(color: Colors.black,fontSize: 13),),
                                    ),
                                    Container(
                                      margin: EdgeInsets.only(bottom: 5),
                                      child: Text('福建省厦门市...',style: TextStyle(color: Colors.grey,fontSize: 11),),
                                    ),
                                    Row(
                                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                      children: [
                                        Container(
                                          margin: EdgeInsets.only(bottom: 5),
                                          child: Text('2017-6-20 18:00',style: TextStyle(color: Colors.grey,fontSize: 11),),
                                        ),
                                        Container(
                                          margin: EdgeInsets.only(bottom: 5),
                                          child: Row(
                                            children: [
                                              GestureDetector(
                                                onTap: (){
                                                },
                                                child: Container(
                                                  margin: EdgeInsets.only(right: 0),
                                                  padding: EdgeInsets.only(top: 3,bottom: 3,left: 10,right: 10),
                                                  decoration: BoxDecoration(
                                                    border: Border(
                                                      top: BorderSide(width: 1,color: Colors.grey),
                                                      left: BorderSide(width: 1,color: Colors.grey),
                                                      right: BorderSide(width: 1,color: Colors.grey),
                                                      bottom: BorderSide(width: 1,color: Colors.grey),
                                                    ),
                                                    borderRadius: BorderRadius.circular(3),
                                                    color: Colors.grey.withOpacity(0.2),
                                                  ),
                                                  child: Text('付款',style: TextStyle(color: Colors.black.withOpacity(0.85),fontSize: 11),),
                                                ),
                                              ),
                                            ],
                                          ),
                                        )
                                      ],
                                    )
                                  ],
                                ),
                              )
                            ],
                          ),
                        ),
                      ),
                      onTap: (){
                        Navigator.of(context).push(new MaterialPageRoute(builder: (BuildContext context){
                          return ;
                        }));
                      },
                    ),
                    GestureDetector(
                      child: Container(
                        color: Colors.white,
                        height: 120,
                        margin: EdgeInsets.only(top: 1),
                        padding: EdgeInsets.only(top: 10,bottom: 0,left: 20,right: 20),
                        child: Container(
                          child: Column(
                            children: [
                              Container(
                                child: Row(
                                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                  children: [
                                    Container(
                                      child: Row(
                                        children: [
                                          Text('跑腿',style: TextStyle(color: Colors.black,fontSize: 12,),),
                                          SizedBox(width: 10,),
                                          Text('加急',style: TextStyle(color: Colors.black,fontSize: 12,),),
                                          SizedBox(width: 30,),
                                          Text('待接单',style: TextStyle(color: Colors.red,fontSize: 12),),
                                        ],
                                      ),
                                    ),
                                    Text('8元',style: TextStyle(color: Colors.black,fontSize: 13),)
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(top: 8),
                                alignment: Alignment.topLeft,
                                child: Column(
                                  mainAxisAlignment: MainAxisAlignment.start,
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  children: [
                                    Container(
                                      margin: EdgeInsets.only(bottom: 8),
                                      child: Text('【加急】任务主题（限制20字）...',style: TextStyle(color: Colors.black,fontSize: 13),),
                                    ),
                                    Container(
                                      margin: EdgeInsets.only(bottom: 5),
                                      child: Text('福建省厦门市...',style: TextStyle(color: Colors.grey,fontSize: 11),),
                                    ),
                                    Row(
                                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                      children: [
                                        Container(
                                          margin: EdgeInsets.only(bottom: 5),
                                          child: Text('2017-6-20 18:00',style: TextStyle(color: Colors.grey,fontSize: 11),),

                                        ),
                                        Container(

                                          margin: EdgeInsets.only(bottom: 5),
                                          child: Row(
                                            children: [
                                              GestureDetector(
                                                onTap: (){
                                                },
                                                child: Container(
                                                  margin: EdgeInsets.only(right: 0),
                                                  padding: EdgeInsets.only(top: 3,bottom: 3,left: 6,right: 6),
                                                  decoration: BoxDecoration(
                                                    border: Border.all(
                                                        width: 1,color: Colors.grey
                                                    ),
                                                    borderRadius: BorderRadius.circular(3),
                                                    color: Colors.grey.withOpacity(0.2),
                                                  ),
                                                  child: Text('取消订单',style: TextStyle(color: Colors.black.withOpacity(0.85),fontSize: 11),),
                                                ),
                                              ),
                                            ],
                                          ),
                                        ),
                                      ],
                                    ),

                                  ],
                                ),
                              )
                            ],
                          ),
                        ),
                      ),
                      onTap: (){
                        Navigator.of(context).push(new MaterialPageRoute(builder: (BuildContext context){
                          return ;
                        }));
                      },
                    ),
                    GestureDetector(
                      child: Container(
                        color: Colors.white,
                        height: 120,
                        margin: EdgeInsets.only(top: 1),
                        padding: EdgeInsets.only(top: 10,bottom: 0,left: 20,right: 20),
                        child: Container(
                          child: Column(
                            children: [
                              Container(
                                child: Row(
                                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                  children: [
                                    Container(
                                      child: Row(
                                        children: [
                                          Text('跑腿',style: TextStyle(color: Colors.black,fontSize: 12,),),
                                          SizedBox(width: 30,),
                                          Text('待接单',style: TextStyle(color: Colors.red,fontSize: 12),),
                                        ],
                                      ),
                                    ),
                                    Text('5元',style: TextStyle(color: Colors.black,fontSize: 13),)
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(top: 8),
                                alignment: Alignment.topLeft,
                                child: Column(
                                  mainAxisAlignment: MainAxisAlignment.start,
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  children: [
                                    Container(
                                      margin: EdgeInsets.only(bottom: 8),
                                      child: Text('任务主题（限制20字）...',style: TextStyle(color: Colors.black,fontSize: 13),),
                                    ),
                                    Container(
                                      margin: EdgeInsets.only(bottom: 5),
                                      child: Text('福建省厦门市...',style: TextStyle(color: Colors.grey,fontSize: 11),),
                                    ),
                                    Row(
                                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                      children: [
                                        Container(
                                          margin: EdgeInsets.only(bottom: 5),
                                          child: Text('2017-6-20 18:00',style: TextStyle(color: Colors.grey,fontSize: 11),),

                                        ),
                                        Container(

                                          margin: EdgeInsets.only(bottom: 5),
                                          child: Row(
                                            children: [
                                              GestureDetector(
                                                onTap: (){
                                                },
                                                child: Container(
                                                  margin: EdgeInsets.only(right: 0),
                                                  padding: EdgeInsets.only(top: 3,bottom: 3,left: 6,right: 6),
                                                  decoration: BoxDecoration(
                                                    border: Border.all(
                                                        width: 1,color: Colors.grey
                                                    ),
                                                    borderRadius: BorderRadius.circular(3),
                                                    color: Colors.grey.withOpacity(0.2),
                                                  ),
                                                  child: Text('取消订单',style: TextStyle(color: Colors.black.withOpacity(0.85),fontSize: 11),),
                                                ),
                                              ),
                                            ],
                                          ),
                                        ),
                                      ],
                                    ),
                                  ],
                                ),
                              )
                            ],
                          ),
                        ),
                      ),
                      onTap: (){
                        Navigator.of(context).push(new MaterialPageRoute(builder: (BuildContext context){
                          return ;
                        }));
                      },
                    ),
                    GestureDetector(
                      child: Container(
                        color: Colors.white,
                        height: 120,
                        margin: EdgeInsets.only(top: 1),
                        padding: EdgeInsets.only(top: 10,bottom: 0,left: 20,right: 20),
                        child: Container(
                          child: Column(
                            children: [
                              Container(
                                child: Row(
                                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                  children: [
                                    Container(
                                      child: Row(
                                        children: [
                                          Text('跑腿',style: TextStyle(color: Colors.black,fontSize: 12,),),
                                          SizedBox(width: 30,),
                                          Text('待确认',style: TextStyle(color: Colors.red,fontSize: 12),),
                                        ],
                                      ),
                                    ),
                                    Text('5元',style: TextStyle(color: Colors.black,fontSize: 13),)
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(top: 8),
                                alignment: Alignment.topLeft,
                                child: Column(
                                  mainAxisAlignment: MainAxisAlignment.start,
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  children: [
                                    Container(
                                      margin: EdgeInsets.only(bottom: 8),
                                      child: Text('任务主题（限制20字）...',style: TextStyle(color: Colors.black,fontSize: 13),),
                                    ),
                                    Container(
                                      margin: EdgeInsets.only(bottom: 5),
                                      child: Text('福建省厦门市...',style: TextStyle(color: Colors.grey,fontSize: 11),),
                                    ),
                                    Row(
                                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                      children: [
                                        Container(
                                          margin: EdgeInsets.only(bottom: 5),
                                          child: Text('2017-6-20 18:00',style: TextStyle(color: Colors.grey,fontSize: 11),),
                                        ),
                                        Container(
                                          margin: EdgeInsets.only(bottom: 5),
                                          child: Row(
                                            children: [
                                              GestureDetector(
                                                onTap: (){

                                                },
                                                child: Container(
                                                  margin: EdgeInsets.only(right: 10),
                                                  padding: EdgeInsets.only(top: 3,bottom: 3,left: 6,right: 6),
                                                  decoration: BoxDecoration(
                                                    border: Border.all(
                                                        width: 1,color: Colors.grey
                                                    ),
                                                    borderRadius: BorderRadius.circular(3),
                                                    color: Colors.grey.withOpacity(0.2),
                                                  ),
                                                  child: Text('确定完成',style: TextStyle(color: Colors.black.withOpacity(0.85),fontSize: 11),),
                                                ),
                                              ),
                                              GestureDetector(
                                                onTap: (){

                                                },
                                                child: Container(
                                                  margin: EdgeInsets.only(right: 0),
                                                  padding: EdgeInsets.only(top: 3,bottom: 3,left: 6,right: 6),
                                                  decoration: BoxDecoration(
                                                    border: Border(
                                                      top: BorderSide(width: 1,color: Colors.grey),
                                                      left: BorderSide(width: 1,color: Colors.grey),
                                                      right: BorderSide(width: 1,color: Colors.grey),
                                                      bottom: BorderSide(width: 1,color: Colors.grey),
                                                    ),
                                                    borderRadius: BorderRadius.circular(3),
                                                    color: Colors.grey.withOpacity(0.2),
                                                  ),
                                                  child: Text('取消订单',style: TextStyle(color: Colors.black.withOpacity(0.85),fontSize: 11),),
                                                ),
                                              ),
                                            ],
                                          ),
                                        )
                                      ],
                                    )
                                  ],
                                ),
                              )
                            ],
                          ),
                        ),
                      ),
                      onTap: (){
                        Navigator.of(context).push(new MaterialPageRoute(builder: (BuildContext context){
                          return ;
                        }));
                      },
                    ),
                    GestureDetector(
                      child: Container(
                        color: Colors.white,
                        height: 120,
                        margin: EdgeInsets.only(top: 1),
                        padding: EdgeInsets.only(top: 10,bottom: 0,left: 20,right: 20),
                        child: Container(
                          child: Column(
                            children: [
                              Container(
                                child: Row(
                                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                  children: [
                                    Container(
                                      child: Row(
                                        children: [
                                          Text('跑腿',style: TextStyle(color: Colors.black,fontSize: 12,),),
                                          SizedBox(width: 30,),
                                          Text('已完成',style: TextStyle(color: Colors.red,fontSize: 12),),
                                        ],
                                      ),
                                    ),
                                    Text('5元',style: TextStyle(color: Colors.black,fontSize: 13),)
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(top: 8),
                                alignment: Alignment.topLeft,
                                child: Column(
                                  mainAxisAlignment: MainAxisAlignment.start,
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  children: [
                                    Container(
                                      margin: EdgeInsets.only(bottom: 8),
                                      child: Text('任务主题（限制20字）...',style: TextStyle(color: Colors.black,fontSize: 13),),
                                    ),
                                    Container(
                                      margin: EdgeInsets.only(bottom: 5),
                                      child: Text('福建省厦门市...',style: TextStyle(color: Colors.grey,fontSize: 11),),
                                    ),
                                    Row(
                                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                      children: [
                                        Container(
                                          margin: EdgeInsets.only(bottom: 5),
                                          child: Text('2017-6-20 18:00',style: TextStyle(color: Colors.grey,fontSize: 11),),
                                        ),
                                        Container(
                                          margin: EdgeInsets.only(bottom: 5),
                                          child: Row(
                                            children: [
                                              GestureDetector(
                                                onTap: (){
                                                },
                                                child: Container(
                                                  margin: EdgeInsets.only(right: 0),
                                                  padding: EdgeInsets.only(top: 3,bottom: 3,left: 10,right: 10),
                                                  decoration: BoxDecoration(
                                                    border: Border(
                                                      top: BorderSide(width: 1,color: Colors.grey),
                                                      left: BorderSide(width: 1,color: Colors.grey),
                                                      right: BorderSide(width: 1,color: Colors.grey),
                                                      bottom: BorderSide(width: 1,color: Colors.grey),
                                                    ),
                                                    borderRadius: BorderRadius.circular(3),
                                                    color: Colors.grey.withOpacity(0.2),
                                                  ),
                                                  child: Text('评价',style: TextStyle(color: Colors.black.withOpacity(0.85),fontSize: 11),),
                                                ),
                                              ),
                                            ],
                                          ),
                                        )
                                      ],
                                    )
                                  ],
                                ),
                              )
                            ],
                          ),
                        ),
                      ),
                      onTap: (){

                      },
                    ),
                    GestureDetector(
                      child: Container(
                        color: Colors.white,
                        height: 120,
                        margin: EdgeInsets.only(top: 1),
                        padding: EdgeInsets.only(top: 10,bottom: 0,left: 20,right: 20),
                        child: Container(
                          child: Column(
                            children: [
                              Container(
                                child: Row(
                                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                  children: [
                                    Container(
                                      child: Row(
                                        children: [
                                          Text('跑腿',style: TextStyle(color: Colors.black,fontSize: 12,),),
                                          SizedBox(width: 30,),
                                          Text('已取消',style: TextStyle(color: Colors.red,fontSize: 12),),
                                        ],
                                      ),
                                    ),
                                    Text('5元',style: TextStyle(color: Colors.black,fontSize: 13),)
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(top: 8),
                                alignment: Alignment.topLeft,
                                child: Column(
                                  mainAxisAlignment: MainAxisAlignment.start,
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  children: [
                                    Container(
                                      margin: EdgeInsets.only(bottom: 8),
                                      child: Text('任务主题（限制20字）...',style: TextStyle(color: Colors.black,fontSize: 13),),
                                    ),
                                    Container(
                                      margin: EdgeInsets.only(bottom: 5),
                                      child: Text('福建省厦门市...',style: TextStyle(color: Colors.grey,fontSize: 11),),
                                    ),

                                    Container(
                                      margin: EdgeInsets.only(bottom: 5),
                                      child: Text('2017-6-20 18:00',style: TextStyle(color: Colors.grey,fontSize: 11),),
                                    ),
                                  ],
                                ),
                              )
                            ],
                          ),
                        ),
                      ),
                      onTap: (){

                      },
                    ),
                    GestureDetector(
                      child: Container(
                        color: Colors.white,
                        height: 120,
                        margin: EdgeInsets.only(top: 1),
                        padding: EdgeInsets.only(top: 10,bottom: 0,left: 20,right: 20),
                        child: Container(
                          child: Column(
                            children: [
                              Container(
                                child: Row(
                                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                  children: [
                                    Container(
                                      child: Row(
                                        children: [
                                          Text('预约',style: TextStyle(color: Colors.black,fontSize: 12,),),
                                          SizedBox(width: 30,),
                                          Text('待付款',style: TextStyle(color: Colors.red,fontSize: 12),),
                                        ],
                                      ),
                                    ),
                                    Text('5元',style: TextStyle(color: Colors.black,fontSize: 13),)
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(top: 8),
                                alignment: Alignment.topLeft,
                                child: Column(
                                  mainAxisAlignment: MainAxisAlignment.start,
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  children: [
                                    Container(
                                      margin: EdgeInsets.only(bottom: 8),
                                      child: Text('任务主题（限制20字）...',style: TextStyle(color: Colors.black,fontSize: 13),),
                                    ),
                                    Container(
                                      margin: EdgeInsets.only(bottom: 5),
                                      child: Text('福建省厦门市...',style: TextStyle(color: Colors.grey,fontSize: 11),),
                                    ),
                                    Row(
                                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                      children: [
                                        Container(
                                          margin: EdgeInsets.only(bottom: 5),
                                          child: Text('2017-6-20 18:00',style: TextStyle(color: Colors.grey,fontSize: 11),),
                                        ),
                                        Container(
                                          margin: EdgeInsets.only(bottom: 5),
                                          child: Row(
                                            children: [
                                              GestureDetector(
                                                onTap: (){
                                                },
                                                child: Container(
                                                  margin: EdgeInsets.only(right: 0),
                                                  padding: EdgeInsets.only(top: 3,bottom: 3,left: 10,right: 10),
                                                  decoration: BoxDecoration(
                                                    border: Border(
                                                      top: BorderSide(width: 1,color: Colors.grey),
                                                      left: BorderSide(width: 1,color: Colors.grey),
                                                      right: BorderSide(width: 1,color: Colors.grey),
                                                      bottom: BorderSide(width: 1,color: Colors.grey),
                                                    ),
                                                    borderRadius: BorderRadius.circular(3),
                                                    color: Colors.grey.withOpacity(0.2),
                                                  ),
                                                  child: Text('付款',style: TextStyle(color: Colors.black.withOpacity(0.85),fontSize: 11),),
                                                ),
                                              ),
                                            ],
                                          ),
                                        )
                                      ],
                                    )
                                  ],
                                ),
                              )
                            ],
                          ),
                        ),
                      ),
                      onTap: (){

                      },
                    ),
                    GestureDetector(
                      child: Container(
                        color: Colors.white,
                        height: 120,
                        margin: EdgeInsets.only(top: 1),
                        padding: EdgeInsets.only(top: 10,bottom: 0,left: 20,right: 20),
                        child: Container(
                          child: Column(
                            children: [
                              Container(
                                child: Row(
                                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                  children: [
                                    Container(
                                      child: Row(
                                        children: [
                                          Text('预约',style: TextStyle(color: Colors.black,fontSize: 12,),),
                                          SizedBox(width: 30,),
                                          Text('待接单',style: TextStyle(color: Colors.red,fontSize: 12),),
                                        ],
                                      ),
                                    ),
                                    Text('5元',style: TextStyle(color: Colors.black,fontSize: 13),)
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(top: 8),
                                alignment: Alignment.topLeft,
                                child: Column(
                                  mainAxisAlignment: MainAxisAlignment.start,
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  children: [
                                    Container(
                                      margin: EdgeInsets.only(bottom: 8),
                                      child: Text('任务主题（限制20字）...',style: TextStyle(color: Colors.black,fontSize: 13),),
                                    ),
                                    Container(
                                      margin: EdgeInsets.only(bottom: 5),
                                      child: Text('福建省厦门市...',style: TextStyle(color: Colors.grey,fontSize: 11),),
                                    ),
                                    Row(
                                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                      children: [
                                        Container(
                                          margin: EdgeInsets.only(bottom: 5),
                                          child: Text('2017-6-20 18:00',style: TextStyle(color: Colors.grey,fontSize: 11),),

                                        ),
                                        Container(

                                          margin: EdgeInsets.only(bottom: 5),
                                          child: Row(
                                            children: [
                                              GestureDetector(
                                                onTap: (){
                                                },
                                                child: Container(
                                                  margin: EdgeInsets.only(right: 0),
                                                  padding: EdgeInsets.only(top: 3,bottom: 3,left: 6,right: 6),
                                                  decoration: BoxDecoration(
                                                    border: Border.all(
                                                        width: 1,color: Colors.grey
                                                    ),
                                                    borderRadius: BorderRadius.circular(3),
                                                    color: Colors.grey.withOpacity(0.2),
                                                  ),
                                                  child: Text('取消订单',style: TextStyle(color: Colors.black.withOpacity(0.85),fontSize: 11),),
                                                ),
                                              ),
                                            ],
                                          ),
                                        ),
                                      ],
                                    ),
                                  ],
                                ),
                              )
                            ],
                          ),
                        ),
                      ),
                      onTap: (){
                        Navigator.of(context).push(new MaterialPageRoute(builder: (BuildContext context){
                          return ;
                        }));
                      },
                    ),
                    GestureDetector(
                      child: Container(
                        color: Colors.white,
                        height: 120,
                        margin: EdgeInsets.only(top: 1),
                        padding: EdgeInsets.only(top: 10,bottom: 0,left: 20,right: 20),
                        child: Container(
                          child: Column(
                            children: [
                              Container(
                                child: Row(
                                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                  children: [
                                    Container(
                                      child: Row(
                                        children: [
                                          Text('预约',style: TextStyle(color: Colors.black,fontSize: 12,),),
                                          SizedBox(width: 30,),
                                          Text('待确认',style: TextStyle(color: Colors.red,fontSize: 12),),
                                        ],
                                      ),
                                    ),
                                    Text('5元',style: TextStyle(color: Colors.black,fontSize: 13),)
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(top: 8),
                                alignment: Alignment.topLeft,
                                child: Column(
                                  mainAxisAlignment: MainAxisAlignment.start,
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  children: [
                                    Container(
                                      margin: EdgeInsets.only(bottom: 8),
                                      child: Text('任务主题（限制20字）...',style: TextStyle(color: Colors.black,fontSize: 13),),
                                    ),
                                    Container(
                                      margin: EdgeInsets.only(bottom: 5),
                                      child: Text('福建省厦门市...',style: TextStyle(color: Colors.grey,fontSize: 11),),
                                    ),
                                    Row(
                                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                      children: [
                                        Container(
                                          margin: EdgeInsets.only(bottom: 5),
                                          child: Text('2017-6-20 18:00',style: TextStyle(color: Colors.grey,fontSize: 11),),
                                        ),
                                        Container(
                                          margin: EdgeInsets.only(bottom: 5),
                                          child: Row(
                                            children: [
                                              GestureDetector(
                                                onTap: (){

                                                },
                                                child: Container(
                                                  margin: EdgeInsets.only(right: 10),
                                                  padding: EdgeInsets.only(top: 3,bottom: 3,left: 6,right: 6),
                                                  decoration: BoxDecoration(
                                                    border: Border.all(
                                                        width: 1,color: Colors.grey
                                                    ),
                                                    borderRadius: BorderRadius.circular(3),
                                                    color: Colors.grey.withOpacity(0.2),
                                                  ),
                                                  child: Text('确定完成',style: TextStyle(color: Colors.black.withOpacity(0.85),fontSize: 11),),
                                                ),
                                              ),
                                              GestureDetector(
                                                onTap: (){

                                                },
                                                child: Container(
                                                  margin: EdgeInsets.only(right: 0),
                                                  padding: EdgeInsets.only(top: 3,bottom: 3,left: 6,right: 6),
                                                  decoration: BoxDecoration(
                                                    border: Border(
                                                      top: BorderSide(width: 1,color: Colors.grey),
                                                      left: BorderSide(width: 1,color: Colors.grey),
                                                      right: BorderSide(width: 1,color: Colors.grey),
                                                      bottom: BorderSide(width: 1,color: Colors.grey),
                                                    ),
                                                    borderRadius: BorderRadius.circular(3),
                                                    color: Colors.grey.withOpacity(0.2),
                                                  ),
                                                  child: Text('取消订单',style: TextStyle(color: Colors.black.withOpacity(0.85),fontSize: 11),),
                                                ),
                                              ),
                                            ],
                                          ),
                                        )
                                      ],
                                    )
                                  ],
                                ),
                              )
                            ],
                          ),
                        ),
                      ),
                      onTap: (){
                        Navigator.of(context).push(new MaterialPageRoute(builder: (BuildContext context){
                          return ;
                        }));
                      },
                    ),
                    GestureDetector(
                      child: Container(
                        color: Colors.white,
                        height: 120,
                        margin: EdgeInsets.only(top: 1),
                        padding: EdgeInsets.only(top: 10,bottom: 0,left: 20,right: 20),
                        child: Container(
                          child: Column(
                            children: [
                              Container(
                                child: Row(
                                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                  children: [
                                    Container(
                                      child: Row(
                                        children: [
                                          Text('预约',style: TextStyle(color: Colors.black,fontSize: 12,),),
                                          SizedBox(width: 30,),
                                          Text('已完成',style: TextStyle(color: Colors.red,fontSize: 12),),
                                        ],
                                      ),
                                    ),
                                    Text('5元',style: TextStyle(color: Colors.black,fontSize: 13),)
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(top: 8),
                                alignment: Alignment.topLeft,
                                child: Column(
                                  mainAxisAlignment: MainAxisAlignment.start,
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  children: [
                                    Container(
                                      margin: EdgeInsets.only(bottom: 8),
                                      child: Text('任务主题（限制20字）...',style: TextStyle(color: Colors.black,fontSize: 13),),
                                    ),
                                    Container(
                                      margin: EdgeInsets.only(bottom: 5),
                                      child: Text('福建省厦门市...',style: TextStyle(color: Colors.grey,fontSize: 11),),
                                    ),
                                    Row(
                                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                      children: [
                                        Container(
                                          margin: EdgeInsets.only(bottom: 5),
                                          child: Text('2017-6-20 18:00',style: TextStyle(color: Colors.grey,fontSize: 11),),
                                        ),
                                        Container(
                                          margin: EdgeInsets.only(bottom: 5),
                                          child: Row(
                                            children: [
                                              GestureDetector(
                                                onTap: (){
                                                },
                                                child: Container(
                                                  margin: EdgeInsets.only(right: 0),
                                                  padding: EdgeInsets.only(top: 3,bottom: 3,left: 10,right: 10),
                                                  decoration: BoxDecoration(
                                                    border: Border(
                                                      top: BorderSide(width: 1,color: Colors.grey),
                                                      left: BorderSide(width: 1,color: Colors.grey),
                                                      right: BorderSide(width: 1,color: Colors.grey),
                                                      bottom: BorderSide(width: 1,color: Colors.grey),
                                                    ),
                                                    borderRadius: BorderRadius.circular(3),
                                                    color: Colors.grey.withOpacity(0.2),
                                                  ),
                                                  child: Text('评价',style: TextStyle(color: Colors.black.withOpacity(0.85),fontSize: 11),),
                                                ),
                                              ),
                                            ],
                                          ),
                                        )
                                      ],
                                    )
                                  ],
                                ),
                              )
                            ],
                          ),
                        ),
                      ),
                      onTap: (){

                      },
                    ),
                    GestureDetector(
                      child: Container(
                        color: Colors.white,
                        height: 120,
                        margin: EdgeInsets.only(top: 1),
                        padding: EdgeInsets.only(top: 10,bottom: 0,left: 20,right: 20),
                        child: Container(
                          child: Column(
                            children: [
                              Container(
                                child: Row(
                                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                  children: [
                                    Container(
                                      child: Row(
                                        children: [
                                          Text('预约',style: TextStyle(color: Colors.black,fontSize: 12,),),
                                          SizedBox(width: 30,),
                                          Text('已取消',style: TextStyle(color: Colors.red,fontSize: 12),),
                                        ],
                                      ),
                                    ),
                                    Text('5元',style: TextStyle(color: Colors.black,fontSize: 13),)
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(top: 8),
                                alignment: Alignment.topLeft,
                                child: Column(
                                  mainAxisAlignment: MainAxisAlignment.start,
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  children: [
                                    Container(
                                      margin: EdgeInsets.only(bottom: 8),
                                      child: Text('任务主题（限制20字）...',style: TextStyle(color: Colors.black,fontSize: 13),),
                                    ),
                                    Container(
                                      margin: EdgeInsets.only(bottom: 5),
                                      child: Text('福建省厦门市...',style: TextStyle(color: Colors.grey,fontSize: 11),),
                                    ),

                                    Container(
                                      margin: EdgeInsets.only(bottom: 5),
                                      child: Text('2017-6-20 18:00',style: TextStyle(color: Colors.grey,fontSize: 11),),
                                    ),
                                  ],
                                ),
                              )
                            ],
                          ),
                        ),
                      ),
                      onTap: (){

                      },
                    ),
                  ],
                ),
              )
          ),
        ),
      ),
    );
  }
}

//------------------------------------------------------------------------------


//-----------------------------构建page2----------------------------------------



//------------------------------------------------------------------------------


//-----------------------------构建page3----------------------------------------



//------------------------------------------------------------------------------


//-----------------------------构建page4----------------------------------------



//------------------------------------------------------------------------------